<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>起飞时间差距设置</title>
<link href="<%=request.getContextPath()%>/fare/css/base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/show.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/datePicker/WdatePicker.js"></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/fare/js/cityquery/citylist.js'></script>
<script type='text/javascript' src='<%=request.getContextPath()%>/fare/js/cityquery/querycity.js'></script>
<link href='<%=request.getContextPath()%>/fare/js/cityquery/cityquery.css' rel="stylesheet" type="text/css" />

<script>
	function showm(sid) {

		var which = document.getElementById("lite" + sid);
		var imgmenu = document.getElementById("ling" + sid);
		if (which.style.display == "none") {
			document.getElementById("lite" + sid).style.display = "";
		} else {
			document.getElementById("lite" + sid).style.display = "none";
		}

	}
</script>
<script type="text/javascript">
	$(document).ready(function(){
		$('#fromCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
		$('#toCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	});
	$(document).ready(function(){
		$('#fromCity2').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
		$('#toCity2').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	});
	
	//保存抓取航空设置提交
	function checkForm() {
		
		if ($("#fromCity").val() == '' || $("#fromCity").val() == '中文/拼音') {
			alert("航段不能为空！");
			$("#fromCity").focus();
			return false;
		}
		if ($("#toCity").val() == '' || $("#toCity").val() == '中文/拼音') {
			alert("航段不能为空！");
			$("#toCity").focus();
			return false;
		}
		
		if ($("#timeGap").val() == '') {
			alert("起飞时间差距不能为空！");
			$("#timeGap").focus();
			return false;
		}
		 var timeGap = $("#timeGap").val();
		 
		 
		 if(isNumber(timeGap)){
			if (parseFloat(timeGap) <0 || parseFloat(timeGap)>100 ) {
				alert("起飞时间差范围从0到100！");
				$("#timeGap").focus();
				return false;
			}
			if(timeGap==0.5){
				alert("0.5是所有航段默认值，不需要设置");
				return false;
			}
			
		$("#taskForm").submit();
		} 
	}
	

	//数值检测 
	function isNumber(txt){  
		
		//被校验的值
		var pattern=/^\d\.\d{1}$/;   
		var pattern2=/^\d$/; 
		if(isNaN(txt))
		{    
			alert("请输入数字!");
			return false;
		}else{
			return true;
		}
	} 

	function showTaskoffTimeList() {
		$("#showTaskoffTimeListForm").submit();
	}

	//分页查询
	function searchOnSubmit() {
		var pageSize = $("#pageSize").val();
		var pageNum = $("#pageNum").val();
		if (pageSize != "" || pageNum != "") {
			$("#taskForm").attr("action","taskInfoAction!showTakeoffTimeList.action?pageSize="+ pageSize + "&pageNum=" + pageNum).submit();
		} else {
			$("#taskForm").submit();
		}
	}
</script>

<style type="text/css">
<!--
.STYLE1 {
	color: #3366cc
}
-->
</style>
</head>

<body>

	<form id="taskForm" action="taskInfoAction!editTakeoffTime.action" method="post">
		<TABLE cellSpacing=1 cellPadding=3 width="100%" border=0 class="tabg">
			<TBODY>
				<TR class="tr1">
					<TD colspan="4">起飞时间差距设置</TD>
				</TR>
				<TR class="tab">
					<TD width="10%" style="text-align: left" height="26" class="td1">配置描述：</TD>
					<TD colspan="3"><textarea style="width: 500px; resize: none;" rows="3" cols="50"></textarea></TD>
				</TR>
				
				<TR class="tab">
					<TD height="26" style="text-align: left" class="td1">起飞时间差距：</TD>
					<TD>
						<input type="text" style="width: 70px" id="timeGap" value="" name="timeGap"
						> <span>小时</span> 
						<span style="color: #FF0000">*(范围从0-100)</span>
					</TD>
					<TD height="26" style="text-align: left" class="td1">航&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;段：</TD>
					<TD>
						<span>从</span> 
						<input type="text" style="width: 100px" id="fromCity" value="" name="fromCity"> 
						<span>到</span> 
						<input type="text" style="width: 100px" id="toCity" value="" name="toCity"> 
						<span style="color: #FF0000">*</span>
					</TD>
				</TR>
	
				<TR class="tab">
					<TD height="26" colspan="8" align="center">
					<input type="button" name="Submit222" value="保存" id="Submit222" style="width: 80px;cursor: pointer; cursor: hand;" 
						onclick="javascript:checkForm();"></TD>
				</TR>
			</TBODY>
		</TABLE>
	</form>

	<p></p>
	<form id="showTaskoffTimeListForm" action="taskInfoAction!showTakeoffTimeList.action" method="post">
		<TABLE cellSpacing=1 cellPadding=3 width="100%" border=0 class="tabg">
			<TBODY>
				<TR class="tr1">
					<TD colspan="2">起飞时间差查询</TD>
				</TR>
	
				<TR class="tab">
					<TD width="10%" style="text-align: left" height="26" class="td1">航&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;段：</TD>
					<TD>
						<span>从 </span> 
						<input type="text" style="width: 100px" id="fromCity2" value="" name="fromCity"> 
						<span>到</span> 
						<input type="text" style="width: 100px" id="toCity2" value="" name="toCity">
					</TD>
				</TR>
	
				<TR class="tab">
					<TD height="26" colspan="2" align="center">
					<input type="button" name="Submit222" value="查询" id="Submit222" style="width: 80px;cursor: pointer; cursor: hand;" 
						onclick="javascript:showTaskoffTimeList();"></TD>
				</TR>
			</TBODY>
		</TABLE>
	
		<p></p>
		<table width="100%" border="0" cellpadding="3" CELLSPACING="1" class="tabg">
			<tr class="tr1">
				<td colspan="7">起飞时间差查询结果</td>
			</tr>
	
			<tr class="tr2">
				<td class="title"></td>
				<td class="title">ID</td>
				<td class="title">航段</td>
				<td class="title">起飞时间差距(小时)</td>
				<td class="title">操作人</td>
				<td class="title">操作时间</td>
				<td class="title">操作</td>
			</tr>
			
			<c:choose>
				<c:when test="${takeoffTimeEntityVOList == null}">
				</c:when>
				<c:otherwise>
					<c:forEach items="${takeoffTimeEntityVOList}" var="task">
						<tr class="tr2" onMouseOver="fSetBg(this)" onMouseOut="fReBg(this)">
							<td><input type="checkbox" name="test3" style="border: 0px;" value="1" onclick="javascript:mycheck(this)"></td>
							<td>${task.id }</td>
							<td>${task.fromcity}-${task.tocity}</td>
							<td>${task.timeGap }</td>
							<td>${task.user.userInfo.names}</td>
							<td><fmt:formatDate pattern="yyyy-MM-dd" value="${task.userCreatetime}" /></td>
							<td>
								<a href="taskInfoAction!editTakeoffTime.action?id=${task.id}&act=update"> 
									<img src="<%=request.getContextPath()%>/fare/images/modify.png" title="修改" style="cursor: pointer; cursor: hand;"/>
								</a>
								<a href="taskInfoAction!deleteTakeoffTimeEntity.action?id=${task.id}" onclick="return confirm('确定要删除吗？')">
									<img src="<%=request.getContextPath()%>/fare/images/delete.gif" title="删除" style="cursor: pointer; cursor: hand;"/>
								</a> 
							</td>
						</tr>
					</c:forEach>
					<tr class="tr2" onMouseOver="fSetBg(this)" onMouseOut="fReBg(this)">
						<td colspan="7" align="right">共${totalCount }条记录&nbsp;&nbsp;&nbsp;每页显示 
							<select name="pageSize" id="pageSize" onchange="searchOnSubmit();">
									<option value="10" <c:if test="${pageSize==10 }">selected='selected'</c:if>>10</option>
									<option value="20" <c:if test="${pageSize==20 }">selected='selected'</c:if>>20</option>
									<option value="40" <c:if test="${pageSize==40 }">selected='selected'</c:if>>40</option>
							</select> 条&nbsp;转跳到第 
							<select name="pageNum" id="pageNum" onchange="searchOnSubmit();">
									<c:choose>
										<c:when test="${pageList == null}">
										</c:when>
										<c:otherwise>
											<c:forEach items="${pageList}" var="i">
												<option value="${i}" <c:if test="${cpage==i }">selected='selected'</c:if>>${i}</option>
											</c:forEach>
										</c:otherwise>
									</c:choose>
							</select> 页&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
					</tr>
				</c:otherwise>
			</c:choose>
		</table>
	</form>
</body>
</html>



